<template>
  <div>
      <head-top></head-top>
      <div class="return">
        <el-button @click="$router.go(-1)">返回</el-button>
      </div>
      <br>
       <el-table
        :data="answerData"
        align="center"
        >
        <el-table-column
        prop="username"
        label="答题人昵称"
        align="center"
        width="180">
        </el-table-column>
        <el-table-column
        align="center"
        label="答题人头像">
          <template slot-scope="scope">
            <img style="width: 40px; height: 40px; border-radius: 50%; overflow: hidden;" :src="scope.row.avatar">
          </template>
        </el-table-column>
         <el-table-column
        prop="mobile"
        label="联系方式"
        align="center"
        width="260">
        </el-table-column>
        <el-table-column
        prop="score"
        label="答题分数"
        align="center"
        width="240">
        </el-table-column>
        <el-table-column
        prop="dateline"
        label="答题日期"
        align="center"
        width="240">
        </el-table-column>
        </el-table>
    </div>
</template>

<script>
import headTop from "../components/headTop";
import visitorPie from "@/components/visitorPie";
import { answerUserList } from '@/api/getData'
export default {
  data() {
    return {
      pieData: {},
      answerData: []
    };
  },
  components: {
    headTop,
    visitorPie
  },
  activated() {
    this.initData();
  },
  methods: {
    async initData() {
      try {
        const { data } = await answerUserList({ ...this.$route.query, orderType: 1, p: 1, size: 20 })
        this.answerData = data.data
      } catch (error) {
        console.log(error)
      }
    }
  }
};
</script>

<style lang="less">
@import "../style/mixin";
.el-table .warning-row {
  background: oldlace;
}

.el-table .success-row {
  background: #f0f9eb;
}
.return {
  margin: 20px;
}
</style>
